<?php 
include "Model/Article.php";
if (isset($_POST['submit'])){
	$a = Article::WithParams($_POST['name'], $_POST['description'], $_POST['image']);
	$r = $a->Save(null);
	
	if (is_string($r)){ echo($r); }
	else if (!$r) { echo("Save Failed!"); }
	else { echo("Saved!"); }
}
else{?>
	<div>
		<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
			Product name: <input type="text" name="name"/>
			<br />
			Product Description: <input type="text" name="description"/>
			<br />
			Product Image: <input type="text" name="image"/>
			<br />
			<input type="submit" name="submit" value="Save" />
		</form>
	</div>
<?php } ?>

